/*
 * SRM 236 Div 1 Prob 1
 */

import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;


public class BusinessTasks
{
	public String getTask(String[] list, int n)
	{
		LinkedList<String> ll = new LinkedList<String> ();
		for (String o:list)
			ll.addLast (o);
		int l = ll.size ();
		int cur = 0;
		for (int i = 0; i < l - 1; ++i) {
			int m = ll.size ();
			int next = (cur + (n-1))%m;
			ll.remove (next);
			cur = next;
		}
		return ll.getFirst ();
	}
	

}
//Powered by KawigiEdit 2.1.4 (beta) modified by pivanof!
